<%-- 
    Document   : left
    Created on : Apr 25, 2011, 2:20:03 PM
    Author     : Dine
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<s:div id="leftContainer" cssClass="ui-widget-content ui-corner-all">
    <s:div id="profileContainer">
        <h3 class="ui-corner-all">Employee Profile</h3>
        <p><b>Employee No:</b><span><s:property value="%{#session.employee.idnumber}"/></span></p>
        <p><b>First Name:</b><span><s:property value="%{#session.employee.firstname}"/></span></p>
        <p><b>Middle Name:</b><span><s:property value="%{#session.employee.middlename}"/></span></p>
        <p><b>Last Name:</b><span><s:property value="%{#session.employee.lastname}"/></span></p>
        <p><b>Role:</b><span><s:property value="%{#session.usertype.type}"/></span></p>
        <p><b>Branch Code:</b><span><s:property value="%{#session.branch.branchcode}"/></span></p>
        <p><b>Branch:</b><span><s:property value="%{#session.branch.branchname}"/></span></p>
        <p><b>Branch Address:</b><span><s:property value="%{#session.branch.location}"/></span></p>
        <sj:a button="true"
              title="Change Password"
              openDialog="changePasswordDialog"
              cssStyle="float:right;font-size:12px;"
              >
            Change Password
        </sj:a>
        <br /><br />
        <hr />
    </s:div>

    <s:div id="employeeFeedbackContainer">
        <h3 class="ui-corner-all">Feedback</h3>
        <s:form action="employee-feedback">
            <s:textarea rows="10" cols="27" cssStyle="resize:none"/>
            <sj:submit cssStyle="font-size:12px;float:right"
                       clearForm="true"
                       value="Submit"
                       effect="highlight"
                       button="true"
                       />
        </s:form>
    </s:div>
    <s:div id="loanSubMenuContainer">
        <s:if test="#session.branch.branchname=='Head Office'">
            <sj:a button="true"
                  id="subMenuLoanApplicationHo"
                  cssClass="subMenu"
                  buttonIcon="ui-icon-note"
                  title="Loan Application"
                  >
                Loan Application
            </sj:a>  
        </s:if>
        <s:else>
            <sj:a button="true"
                  id="subMenuLoanApplication"
                  cssClass="subMenu"
                  buttonIcon="ui-icon-note"
                  title="Loan Application"
                  >
                Loan Application
            </sj:a>  
        </s:else>
        <sj:a button="true"
              id="subMenuLoanRequest"
              cssClass="subMenu"
              buttonIcon="ui-icon-mail-closed"
              title="Loan Request"
              >
            Loan Request
        </sj:a>      
        <sj:a button="true"
              id="subMenuLoanApproval"
              cssClass="subMenu"
              buttonIcon="ui-icon-check"
              title="Loan Approval"
              >
            Loan Approval
        </sj:a>
        <sj:a button="true"
              id="subMenuLoanCheckRegister"
              cssClass="subMenu"
              buttonIcon="ui-icon-calculator"
              title="Loan Check Register"
              >
            Loan Check Register
        </sj:a>
        <sj:a button="true"
              id="subMenuLoanRelease"
              cssClass="subMenu"
              buttonIcon="ui-icon-mail-open"
              title="Loan Release"
              >
            Loan Release
        </sj:a>
        <sj:a button="true"
              id="subMenuLoanCollection"
              cssClass="subMenu"
              buttonIcon="ui-icon-cart"
              title="Loan Collection"
              >
            Loan Collection
        </sj:a>
        <sj:a button="true"
              id="subMenuLoanVerification"
              cssClass="subMenu"
              buttonIcon="ui-icon-help"
              title="Loan Verification"
              >
            Loan Inquiry
        </sj:a>
        <sj:a button="true"
              id="subMenuCCR"
              cssClass="subMenu"
              buttonIcon="ui-icon-clipboard"
              title="Cash Custodian Report"
              >
            Cash Custodian Report
        </sj:a>

        <hr />
    </s:div>
    <s:div id="loanApplicationSubMenu" cssClass="innerSubMenu">
        <sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_appli"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Application"
              >
            Application Form
        </sj:a>
        <sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_credit"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Credit Investigation"
              >
            Credit Investigation
        </sj:a>
        <sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_appraise"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Appraisal"
              >
            Appraisal Report
        </sj:a>
        <sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_matrix"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Credit Matrix"
              >
            Credit Matrix
        </sj:a>
        <%--<sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_gridappl"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Saved Applications"
              >
            Saved Application Forms
        </sj:a>
        <sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_gridcred"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Saved CI"
              >
            Saved CIs
        </sj:a>
        <sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_gridappr"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Saved Appraisals"
              >
            Saved Appraisals
        </sj:a>--%>
        <%--<sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_gridloanapplisaved"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Saved Loan Applications"
              >
            Saved Loan Applications
        </sj:a>--%>
        <sj:a button="true"
              cssStyle="font-size: 12px"
              id="loanApplicationSubMenu_gridloanappliposted"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Loan Applications"
              >
            All Loan Applications
        </sj:a>
    </s:div> <%--Loan Application Sub-Menu--%>
    <s:div id="loanApplicationHoSubMenu" cssClass="innerSubMenu">
        <sj:a button="true"
              id="loanApplicationHoSubMenu_gridloanappliposted"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="All Loan Applications"
              >
            All Loan Applications
        </sj:a>
    </s:div>
    <s:div id="loanRequestSubMenu" cssClass="innerSubMenu">
        <sj:a button="true"
              id="loanRequestSubMenu_loanappli"
              buttonIcon="ui-icon-note"
              cssClass="innerSubMenu"
              title="Create Request"
              >
            Create Request
        </sj:a>
        <sj:a button="true"
              id="loanRequestSubMenu_branchcash"
              buttonIcon="ui-icon-mail-closed"
              cssClass="innerSubMenu"
              title="Send Request"
              >
            Send Request
        </sj:a>
        <%--<sj:a button="true"
              id="loanRequestSubMenu_branchman"
              buttonIcon="ui-icon-mail-closed"
              cssClass="innerSubMenu"
              title="Send Request"
              >
            Send Request
        </sj:a>--%>
        <%--<sj:a button="true"
              id="loanRequestSubMenu_headoffice"
              buttonIcon="ui-icon-mail-closed"
              cssClass="innerSubMenu"
              title="Head Office Verification"
              >
            Head Office Verification
        </sj:a> --%>  
    </s:div><%-- Loan Request Sub-Menu --%>
    <s:div id="loanApprovalSubMenu" cssClass="innerSubMenu">
        <sj:a button="true"
              id="loanApprovalSubMenu_request"
              buttonIcon="ui-icon-check"
              cssClass="innerSubMenu"
              title="View Requests"
              >
            View Requests
        </sj:a>
        <sj:a button="true"
              id="loanApprovalSubMenu_approved"
              buttonIcon="ui-icon-check"
              cssClass="innerSubMenu"
              title="Approved Loan Applications"
              >
            Approved Loan Applications
        </sj:a>
        <sj:a button="true"
              id="loanApprovalSubMenu_disapproved"
              buttonIcon="ui-icon-check"
              cssClass="innerSubMenu"
              title="Disapproved Loan Applications"
              >
            Disapproved Loan Applications
        </sj:a>
    </s:div> <%--Loan Approval Sub-Menu--%>
    <s:div id="loanReleaseSubMenu" cssClass="innerSubMenu">
        <%--<sj:a button="true"
              id="loanReleaseSubMenu_check"
              buttonIcon="ui-icon-mail-open"
              cssClass="innerSubMenu"
              title="Check Register"
              >
            Check Register
        </sj:a>--%>
        <sj:a button="true"
              id="loanReleaseSubMenu_voucher"
              buttonIcon="ui-icon-mail-open"
              cssClass="innerSubMenu"
              title="Release Voucher"
              >
            Release Voucher
        </sj:a>
        <sj:a button="true"
              id="loanReleaseSubMenu_receipt"
              buttonIcon="ui-icon-mail-open"
              cssClass="innerSubMenu"
              title="Print Acknowledgement Receipt"
              >
            Print Acknowledgement Receipt
        </sj:a>
    </s:div> <%--Loan Release Sub-Menu--%>
    <s:div id="loanCheckRegisterSubMenu" cssClass="innerSubMenu">
        <sj:a button="true"
              id="loanCheckRegisterSubMenu_check"
              buttonIcon="ui-icon-mail-open"
              cssClass="innerSubMenu"
              title="Check Register"
              >
            Check Register
        </sj:a>
    </s:div> <%--Loan CheckRegister Sub-Menu--%>
    <s:div id="loanCollectionSubMenu" cssClass="innerSubMenu">
        <s:if test="#session.branch.branchname=='Head Office'">
            <sj:a button="true"
                  id="loanCollectionSubMenu_allcoll"
                  buttonIcon="ui-icon-cart"
                  cssClass="innerSubMenu"
                  title="Collection"
                  >
                All Collections
            </sj:a>
            <sj:a button="true"
                  id="loanCollectionSubMenu_allpayment"
                  buttonIcon="ui-icon-cart"
                  cssClass="innerSubMenu"
                  title="Payments"
                  >
                All Payments
            </sj:a>
        </s:if>  
        <s:else>
            <sj:a button="true"
                  id="loanCollectionSubMenu_coll"
                  buttonIcon="ui-icon-cart"
                  cssClass="innerSubMenu"
                  title="Collection"
                  >
                Collection
            </sj:a>
            <sj:a button="true"
                  id="loanCollectionSubMenu_dcr"
                  buttonIcon="ui-icon-cart"
                  cssClass="innerSubMenu"
                  title="Daily Collection Form"
                  >
                Daily Collection Form
            </sj:a>
        </s:else>

    </s:div>
    <script type="text/javascript">
        $('h1#contentHeader').html('<span id="level1">'+this.title+'</span>');
        if("${param.type}" == 'home'){
            $('#profileContainer').css("display","block");
            $('#employeeFeedbackContainer').css("display","block");
        }
        if("${param.type}" == 'loan'){
            $('#loanSubMenuContainer').css("display","block");
        }
        if("${param.innerType}" == 'loanapplication'){
            $('#loanApplicationSubMenu').css("display","block");
        }
        
        if("${param.innerType}" == 'loanapplicationho'){
            $('#loanApplicationHoSubMenu').css("display","block");
        }
        
        if("${param.innerType}" == 'loancollection'){
            $('#loanCollectionSubMenu').css("display","block");
        }
        
        if("${param.innerType}" == 'loanrequest'){
            $('#loanRequestSubMenu').css("display","block");
        }
        
        if("${param.innerType}" == 'loanapproval'){
            $('#loanApprovalSubMenu').css("display","block");
        }
        
        if("${param.innerType}" == 'loanrelease'){
            $('#loanReleaseSubMenu').css("display","block");
        }
        
        if("${param.innerType}" == 'loancheckregister'){
            $('#loanCheckRegisterSubMenu').css("display","block");
        }
        
        
        var element1 = document.getElementById("${param.select1}");
        var element2 = document.getElementById("${param.select2}");

        if(element1)
            $(element1).addClass("ui-state-highlight");
        if(element2)
            $(element2).addClass("ui-state-highlight");
    </script>
</s:div>


